package com.qidian.mes.md.service.impl;

import com.qidian.mes.md.mapper.MdToolResourcesMapper;
import com.qidian.mes.md.service.MdToolResourceService;
import com.qidian.mes.md.vo.MdToolResourceVO;
import com.qidian.mes.util.pojo.QdResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: 小可怎么都睡不够
 * @Description:
 * @Time: 2024-04-11 16:10
 **/
@Service
public class MdToolResourceServiceImpl implements MdToolResourceService {

    @Autowired
    private MdToolResourcesMapper mdToolResourcesMapper;

    @Override
    public QdResult getToolResources(Integer idWork) {
        return QdResult.success(mdToolResourcesMapper.getToolResources(idWork));
    }

    @Override
    public QdResult insertToolResources(MdToolResourceVO mdToolResourceVO) {
        mdToolResourcesMapper.insertToolResources(mdToolResourceVO);
        return QdResult.success("插入成功");
    }

    @Override
    public QdResult deleteToolResources(MdToolResourceVO mdToolResourceVO) {
        mdToolResourcesMapper.deleteToolResources(mdToolResourceVO);
        return QdResult.success("删除成功");
    }

    @Override
    public QdResult updateToolResources(MdToolResourceVO mdToolResourceVO) {
        mdToolResourcesMapper.updateToolResources(mdToolResourceVO);
        return QdResult.success("修改成功");

    }

    @Override
    public QdResult getToolsByName(String name) {
        return QdResult.success(mdToolResourcesMapper.getToolByName(name));
    }
}
